package com.culture.bootdemo.model.req;

import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/**
 * @author wen
 * @date 2019/10/29 16:13
 * @Description
 **/
@Data
public class SwaggerReq {

    @NotBlank(message = "文章id不能为空！")
    @Length(min = 32, max = 32, message = "essayId字段长度应为32位！")
    @ApiParam(required = true)
    @ApiModelProperty("文章id")
    private String essayId;

    @NotNull(message = "文章类型不能为空！")
    @Range(min = 0, max = 1, message = "文章类型状态码无效！")
    @ApiModelProperty("文章类型（0：文章，1视频）")
    private Integer essayType;

    @NotNull(message = "考题数量不能为空！")
    @ApiParam(required = true)
    @ApiModelProperty("选取考题数量")
    private Integer chooseQuestionNum;

    @NotBlank(message="年龄不能为空")
    @Pattern(regexp="^[0-9]{1,2}$",message="年龄不正确")
    private String age;

    @Pattern(regexp="^[0-9]{4}-[0-9]{2}-[0-9]{2}$",message="出生日期格式不正确")
    private String birthday;
}
